<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
</h:head>
<h:body>
	<ui:include src="../horizontal_menu.xhtml">
	</ui:include>
	<h:form enctype="multipart/form-data">
				<p:panel header="Party Creation">
					<h:panelGrid columns="3" id="regGrid">
					
						<h:outputLabel for="name">Name: </h:outputLabel>
						<p:inputText id="name"  binding="#{partyCreationBean.text1}" value="#{partyCreationBean.party.name}" />
						<h:message id="mname" for="name" />
						
						<h:outputLabel for="symbol" required="true">Symbol: </h:outputLabel>
   						<p:fileUpload id="symbol" value="#{partyCreationBean.file}"  binding="#{partyCreationBean.imgUploader}" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" required="true" sizeLimit="100000" description="Select Images" mode="simple" />
						<h:message for="symbol" />
						
						<h:outputLabel for="program">Program: </h:outputLabel>
						<p:inputTextarea rows="10" cols="60" id="program"  value="#{partyCreationBean.party.program}"  counter="display" maxlength="510" counterTemplate="{0} characters remaining." autoResize="false" />
						<h:message for="program" />
						
						<h:outputText />
						<h:outputText id="display" />
						<h:outputText />
						
						<h:outputLabel for="upcv" required="true">Curriculum vitae: </h:outputLabel>
   						<p:fileUpload id="upcv" value="#{partyCreationBean.pdffile}" binding="#{partyCreationBean.pdfUploader}"  required="true" allowTypes="/(\.|\/)(pdf)$/" sizeLimit="5000000" description="Select Images" mode="simple" />
						<h:message for="upcv" />
						
					</h:panelGrid>
				<p:commandButton value="Submit" ajax="false"  
                action="#{partyCreationBean.commitNewParty()}"/>  

				</p:panel>
		</h:form>
	
</h:body>
</html>